package com.hgq.jssjyyxt.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hgq.jssjyyxt.mapper.SportsNewsMapper;
import com.hgq.jssjyyxt.entity.SportsNews;
import com.hgq.jssjyyxt.service.SportsNewsService;
import org.springframework.stereotype.Service;
import com.hgq.jssjyyxt.util.Result;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * (SportsNews)表服务实现类
 *
 * @author makejava
 * @since 2024-04-11 13:53:44
 */
@Service("sportsNewsService")
public class SportsNewsServiceImpl extends ServiceImpl<SportsNewsMapper, SportsNews> implements SportsNewsService {


    @Override
    public Result selectAll(SportsNews sportsNews, Integer limit, Integer page) {
        List<Map<String, Object>> list = baseMapper.selectAll(sportsNews, (page - 1) * limit, limit);
        HashMap<String, Object> result = new HashMap<>();
        result.put("count", baseMapper.selectAllCount(sportsNews));
        result.put("data", list);
        return Result.success(result);
    }
}

